package io;

import java.io.*;

/**
 * 说明:
 *
 * @author: luohaowei
 * @date:2023/3/8
 **/
public class CopyDemoBuffered {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("wx.jpg");
        BufferedInputStream bis=new BufferedInputStream(fis);
        FileOutputStream fos=new FileOutputStream("wx._2jph");
        BufferedOutputStream bos=new BufferedOutputStream(fos);
        long start=System.currentTimeMillis();
        int d;
        while ((d=bis.read())!=-1){
            bos.write(d);
        }
        long end=System.currentTimeMillis();
        System.out.println();
        bis.close();
        bos.close();
        /*
        FileInputStream fis=new FileInputStream("wx.jpg");
        BufferedInputStream bis=new BufferedInputStream(fis);
        FileOutputStream  fos=new FileOutputStream(wx_2.jph);
        BufferedOutputStream bos=new BufferedOutStream(fos);
        long statr=System.currentTimeMillis();
        int d;
        while((d=bis.read())!=-1){
            bos.write(d);
        }
        lomg end=System.currentTimeMillis();
        System.out.prineln("复制完成!耗时:"+(end-start)+"ms");
        bis.close();
        bos.close();


         */
    }
}
